home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / catD / pcibr_rrb.z / pcibr_rrb
Encoding:
Text File  |  2001-04-17  |  7.3 KB  |  199 lines

  1.  
  2.  
  3.  
  4. ppppcccciiiibbbbrrrr____rrrrrrrrbbbb((((DDDD3333))))                                                    ppppcccciiiibbbbrrrr____rrrrrrrrbbbb((((DDDD3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _pppp_cccc_iiii_bbbb_rrrr______rrrr_rrrr_bbbb______cccc_hhhh_eeee_cccc_kkkk - query RRB allocation
  10.      _pppp_cccc_iiii_bbbb_rrrr______rrrr_rrrr_bbbb______aaaa_llll_llll_oooo_cccc - allocate RRBs for this slot
  11.      _pppp_cccc_iiii_bbbb_rrrr______aaaa_llll_llll_oooo_cccc______aaaa_llll_llll______rrrr_rrrr_bbbb_ssss - allocate RRBs for slot group
  12.      _pppp_cccc_iiii_bbbb_rrrr______ssss_eeee_tttt______rrrr_rrrr_bbbb______cccc_aaaa_llll_llll_bbbb_aaaa_cccc_kkkk - set up allocation callback
  13.  
  14. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  15.      #include <sys/PCI/pcibr.h>
  16.  
  17.      int
  18.      pcibr_rrb_alloc(
  19.                vertex_hdl_t _p_c_o_n_n__v_h_d_l,
  20.                int *_c_o_u_n_t__v_c_h_a_n_0,
  21.                int *_c_o_u_n_t__v_c_h_a_n_1)
  22.  
  23.      int
  24.      pcibr_rrb_check(vertex_hdl_t _p_c_o_n_n__v_h_d_l,
  25.                int *_c_o_u_n_t__v_c_h_a_n_0,
  26.                int *_c_o_u_n_t__v_c_h_a_n_1,
  27.                int *_c_o_u_n_t__r_e_s_e_r_v_e_d,
  28.                int *_c_o_u_n_t__p_o_o_l)
  29.  
  30.      int
  31.      pcibr_alloc_all_rrbs(
  32.                vertex_hdl_t _x_c_o_n_n__v_h_d_l,
  33.                int _e_v_e_n__o_d_d,
  34.                int _d_e_v__1__r_r_b_s, int _v_i_r_t_1,
  35.                int _d_e_v__2__r_r_b_s, int _v_i_r_t_2,
  36.                int _d_e_v__3__r_r_b_s, int _v_i_r_t_3,
  37.                int _d_e_v__4__r_r_b_s, int _v_i_r_t_4)
  38.  
  39.      void
  40.      pcibr_set_rrb_callback(
  41.                vertex_hdl_t _x_c_o_n_n__v_h_d_l,
  42.                rrb_alloc_funct_t _r_r_b__a_l_l_o_c__f_u_n_c_t)
  43.  
  44.  
  45.  
  46.    AAAArrrrgggguuuummmmeeeennnnttttssss
  47.      _p_c_o_n_n__v_h_d_l
  48.              is an appropriate PCI connection point.
  49.  
  50.      _x_c_o_n_n__v_h_d_l
  51.              is an appropriate XIO connection point.
  52.  
  53.      _c_o_u_n_t__v_c_h_a_n_0, _c_o_u_n_t__v_c_h_a_n_1
  54.              is where to get and where to return RRB counts for the primary
  55.              and alternate virtual DMA channels.
  56.  
  57.      _e_v_e_n__o_d_d
  58.              specifies whether _p_c_i_b_r__a_l_l_o_c__a_l_l__r_r_b_s() is operating on the RRB
  59.              allocations for the even numbered or the odd numbered PCI DMA
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ppppcccciiiibbbbrrrr____rrrrrrrrbbbb((((DDDD3333))))                                                    ppppcccciiiibbbbrrrr____rrrrrrrrbbbb((((DDDD3333))))
  71.  
  72.  
  73.  
  74.              REQ/GNT pairs.  Zero specifies the even pairs, One specifies the
  75.              odd pairs.
  76.  
  77.      _d_e_v__N__r_r_b_s
  78.              specifies the total RRBs to be allocated for both virtual
  79.              channels for the corresponding REQ/GNT pair.
  80.  
  81.      _v_i_r_t_N   specifies whether alternate virtual channel accesses will be made
  82.              using the corresponding REQ/GNT pair.
  83.  
  84. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  85.      Drivers are not normally expected to need to call any of these functions;
  86.      they exist for the use of drivers that service devices that actually
  87.      contain the SGI XIO-PCI Bridge ASIC.
  88.  
  89.      _p_c_i_b_r__r_r_b__a_l_l_o_c() is used to adjust the allocation for a specific PCI DMA
  90.      REQ/GNT pair, when the automatic allocation is insufficient, without
  91.      modifying the RRB allocations for other REQ/GNT pairs.
  92.  
  93.      _p_c_i_b_r__r_r_b__c_h_e_c_k() can be used to observe the current RRB allocation state
  94.      for a REQ/GNT pair without changing it.  Note that the pool value
  95.      returned may change as other device drivers within the same RRB pool
  96.      allocate RRBs.
  97.  
  98.      _p_c_i_b_r__a_l_l_o_c__a_l_l__r_r_b_s() can be used to efficiently set up the allocation
  99.      for all four devices in the RRB pool.
  100.  
  101.      The most common time to modify RRBs is from a NIC callback based on
  102.      recognizing the XIO part number.  However, some drivers may want to do
  103.      further RRB adjustment after the infrastructure hsa probed the contents
  104.      of the PCI bus.  _p_c_i_b_r__s_e_t__r_r_b__c_a_l_l_b_a_c_k() can be used to specify a
  105.      function to be called when pcibr has finished taking inventory on the
  106.      bus; it is passed the XIO connection point and an array containing the
  107.      VENDOR_ID values from the eight PCI slots.
  108.  
  109.    AAAAuuuuttttoooommmmaaaattttiiiicccc RRRRRRRRBBBB MMMMaaaannnnaaaaggggeeeemmmmeeeennnntttt
  110.      During the booting process, the pcibr module observes the RRB allocations
  111.      that may have been made by the boot prom.  Any RRBs assigned to REQ/GNT
  112.      pairs corresponding to IDSEL pins on which there is no response (and
  113.      which are not noted specially as secondary REQ/GNT pairs using the pcibr
  114.      hint mechanism are unassigned.
  115.  
  116.      Based on the number of unassigned RRBs in each group, the number of
  117.      active PCI DMA REQ/GNT pairs and the preallocation of RRBs, some
  118.      unassigned RRBs will be reserved for each active REQ/GNT pair so that
  119.      each pair can have up to three RRBs.  The reservation level may be
  120.      decreased to avoid overbooking the RRBs.
  121.  
  122.      When DMA related requests are received by pcibr from pciio, a check is
  123.      made that at least one RRB is actually assigned to that REQ/GNT pair and
  124.      virtual channel; if not, one is assigned, either from that pair's
  125.      reservation pool or from the free pool.  If the DMA is marked as
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ppppcccciiiibbbbrrrr____rrrrrrrrbbbb((((DDDD3333))))                                                    ppppcccciiiibbbbrrrr____rrrrrrrrbbbb((((DDDD3333))))
  137.  
  138.  
  139.  
  140.      PREFETCH, an attempt is made to allocate a second RRB.
  141.  
  142.      In nearly all cases, the above algorithm provides sufficient RRB
  143.      resources for optimum DMA performance.
  144.  
  145. NNNNOOOOTTTTEEEESSSS
  146.      Failure to automatically allocate an RRB does not currently cause a
  147.      failure to map the DMA, but if no RRBs are assigned and the device
  148.      attempts to do a read it will stall forever on the PCI bus.
  149.  
  150. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  151.      nic_vmc(D3), pcibr_hints(D3), pciio(D3)
  152.  
  153. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  154.      All functions return zero if all went well, or negative if there was a
  155.      problem.
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.